package JavaExercise;

import java.util.Scanner;

public class Page14_1 {
    static Scanner sc= new Scanner(System.in);
    public static void main(String[] args) {
        System.out.println("输入你想求阶乘的数");
        long x = sc.nextInt();
        long z;
        z=Factorial(x);
        System.out.println(x+"的阶乘是"+z);
    }
    public static long Factorial(long x){
        for (long i=x-1;i>0;i--){
            x*=i;
        }
        return x;
    }
}
